<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>快递专区</title>
	<meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
	<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/ji_scss.css?saasd=2">
	<link rel="stylesheet" href="<?php echo IMG_PATH ?>bdkd/css/reset.css">
	<link href="apple-touch-icon.png" rel="apple-touch-icon">

    <link href="https://cdn.bootcss.com/framework7/1.6.5/css/framework7.ios.min.css" rel="stylesheet">
    <link href="https://cdn.bootcss.com/framework7/1.6.5/css/framework7.ios.colors.min.css" rel="stylesheet">
	
    <link href="<?php echo IMG_PATH ?>bdkd/css/ji_style.css" rel="stylesheet">
	<script src="http://g.tbcdn.cn/mtb/lib-flexible/0.3.4/??flexible_css.js,flexible.js"></script>
	<script src="<?php echo IMG_PATH ?>bdkd/js/ji_flexible.js"></script>
	<script src="<?php echo IMG_PATH ?>bdkd/js/jquery-1.11.1.min.js"></script>
	<style>
        *{
            a:active{
                text-decoration:none;
            }
            a:link{
                text-decoration:none;
            }
            a:visited{
                text-decoration:none;
            }
            a:hover{
                text-decoration:none;
            }
        }
	</style>
</head>
<body>
	<nav>
		<a style="text-decoration: none;"><div onclick="sendgood()"><span>寄快递</span></div></a>
        <a style="text-decoration: none;"><div onclick="qu()"><span>取快递</span></div></a>
        <a style="text-decoration: none;"><div onclick="wu()"><span>物流托运</span></div></a>
		<div class="gongneng">
			<p>功能</p>
			<img src="<?php echo IMG_PATH ?>bdkd/img/xiala@2x.png" alt="">
			<div class="kuaidigongsi" style="display:none">
				<ul>
					<a><div onclick="price()"><li>价格查询</li></div></a>
					<a><div onclick="time()"><li>时效查询</li></div></a>
                    <a><div onclick="jx()"><li>禁寄物品</li></div></a>
                    <a><div onclick="sm()"><li>免责声明</li></div></a>
				</ul>
			</div>
		</div>
	</nav>
<!--	<a onclick="window.open('../dizhi1/dizhi.html?path=1')" class="fajianren">-->
    <a onclick="sendinfo()" class="fajianren">
		<div class="yuan">
			<div class="dian"></div>
		</div>
        <input type="hidden" name="gsmz" id="gsmz" value="" >
        <input type="hidden" name="sname" id="sname1" value="" >
        <input type="hidden" name="sphone" id="sphone1" value="" >
		<div class="fajianrenxinxi">
			<input type="text" class="rjx-fajianren rjx-fjr1" placeholder="发件人信息" value="" readonly="readonly" >
			<textarea id="saddress" name="text" placeholder="请输入详细的发件人信息,以便我们更好地完成您的需要" value="" readonly="readonly" class="rjx-fjrxx"></textarea>
		</div>
	</a>
<!--	<a onclick="window.open('../dizhi1/dizhi.html?path=2')" class="shoujianren">-->
    <a onclick="getinfo()" class="shoujianren">
		<div class="yuan-one">
			<div class="dian-one"></div>
		</div>
        <input type="hidden" name="gname" id="gname1" value="" >
        <input type="hidden" name="gphone" id="gphone1" value="" >

		<div class="shoujianrenxinxi">
			<input type="text" value="" placeholder="收件人信息" readonly="readonly" class="rjx-sjr1">
			<textarea id="gaddress" name="text" class="rjx-sjrxx" placeholder="请输入详细的收件人信息,以便我们更好地完成您的需要" value="" readonly="readonly"></textarea>
		</div>
	</a>
	<div class="lxsj">
        <div class="lxzl" onclick="weight()">
            <span>类型重量</span>
            <div class="zhongliang">

                <input class="goods" name="good_type" type="text" readonly value="日用品"/>
                <div id="dv"><label></label></div>
                <input style="color:black" id="bmmc" type="text" disabled="true" readonly="readonly"/>
                <input type="hidden" name="weight" value="" class="zhongliang">
            </div>
            <img src="<?php echo IMG_PATH ?>bdkd/img/fanhui@2x.png" alt="">
        </div>
		<div class="phone jjsj" style="border:none;">
			<!-- <span>寄件时间</span>
			<span>9:00-10:00<img src="./img/fanhui@2x.png" alt=""></span> -->
		
		
				<div class="views" style="width:100%;">       
				                    <div class="list-block" style="margin:0px;">
				                        <ul>                    
				                            <li>
				                                <div class="item-content">
				                                    <div class="item-inner" style="padding-right:0px;">
				                                        <div class="item-title label">
				                                        寄件时间
				                                            <font class="color-red"></font>
				                                        </div>
				                                        <div class="item-input">
				                                            <input type="text" placeholder="9:00-10:00" readonly id="location" name="location">
				                                        </div>
				                                         <img src="<?php echo IMG_PATH ?>bdkd/img/fanhui@2x.png" alt="">
				                                    </div>
				                                </div>
				                            </li>                         
				                        </ul>
				                    </div>
							    </div>
			
			    <script src="<?php echo IMG_PATH ?>bdkd/js/ji_jquery.min.js"></script>
			    <script src="<?php echo IMG_PATH ?>bdkd/js/ji_framework7.min.js"></script>
			    <script src="<?php echo IMG_PATH ?>bdkd/js/ji_regionsObject2.js"></script>
			    <script src="<?php echo IMG_PATH ?>bdkd/js/ji_cityPicker.js"></script>
		</div>
	</div>
	<div class="xiangshuode">
		<textarea id="content" name="text" placeholder="请输入想对我们说的...( 可不填 )" value="" class="wenben-xsd"></textarea>
	</div>
	<div class="yunfei">
		<span>运费估算</span>
		<span><input name="money" class="money" type="number" readonly value="90" />元</span>
	</div>
	<div class="fuwuxieyi">
		<div class="anniu">
			<span>
				<img class="danxuan-btn" src="<?php echo IMG_PATH ?>bdkd/img/yhq@2x.png" alt="">
			</span>
			
			<span>我已阅读并同意</span>
			<a onclick="xy()">《便递服务协议》</a>
		</div>
		<div class="btn" onclick="send()">开始寄件</div>
        <input class="xyzt" name="xyzt" type="hidden" value="">
	</div>
<!--    <p><a style=" display:inline-block;width: 4rem; height: 2rem; border: 1px solid #006600;" href="javascript:window.location.reload()">刷新</a></p>
--> <script type="text/javascript">
        var oHeight = $(document).height();
        //console.log(oHeight);
        function jx() {
            window.location.href = '<?php echo SITE_PATH ?>work/bpost/jx';
        }
        function sm() {
            window.location.href = '<?php echo SITE_PATH ?>work/bpost/sm';
        }

        function price() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/price';
        }
        function time() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/time';
        }
        function xy() {
            window.location.href = '<?php echo SITE_PATH ?>work/bpost/jxy';
        }

        function send(){
            var i = $('.xyzt').val();
            if(i==0){
                alert('请阅读并同意《便递服务协议》');
                return false;
            }

            var sname=$(" input[ name='sname' ] ").val();
            //alert(sname);
            var sphone=$(" input[ name='sphone' ] ").val();
            var gname=$(" input[ name='gname' ] ").val();
            var gphone=$(" input[ name='gphone' ] ").val();
            var saddress=$("#saddress").val();
            var gaddress=$("#gaddress").val();
            var good_type=$(" input[ name='good_type' ] ").val();
            var weight= $(" input[ name='weight' ] ").val();
            var express_type= $(" input[ name='gsmz' ] ").val();
            //location
            var time=$(" input[ name='location' ] ").val();

            var content=$("#content").val();
            var money=$(" input[ name='money' ] ").val();
            var xyzt=$(" input[ name='xyzt' ] ").val();
          // alert(saddress);

            $.ajax({
                url:"<?php echo SITE_PATH ?>work/bexpress/sendOrder",
                type:"post",
                data:{
                    'sname': sname,
                    'sphone': sphone,
                    'gname': gname,
                    'gphone': gphone,
                    'saddress': saddress,
                    'gaddress': gaddress,
                    'good_type' : good_type,
                    'weight' : weight,
                    'time' : time,
                    'express_type': express_type,
                    'content' : content,
                    'money' : money
                },
                success: function(data){
                    console.log(data);
                    if(data.result==1){
                        alert('提交成功!');
                    }else {
                        alert(data.msg);
                    }
                },
                error: function(){
                    alert('提交失败0!');
                }
//                async:"false";
            })
        }



        $('.gongneng').click(function(){
            var bianliang=$(".kuaidigongsi").css("display");
            if(bianliang==="none"){
                $('.kuaidigongsi').css('display','block');
            }else{
                $('.kuaidigongsi').css('display','none');
            }

        });
        $.each($(".kuaidigongsi ul li"),function(index,item){
            $(item).click(function(){
                $(".kuaidigongsi ul li").removeClass("custom_bg");
                $(this).addClass("custom_bg");
            });
        });
        $('.wenben-xsd').focus(function(){
                if($(document).height() < oHeight){
//                    alert(2);
                    $(".yunfei,.fuwuxieyi,.xiangshuode,.jjsj").css("display","none");
                }else{
//                    alert(3);
                    console.log(3);
                    $(".yunfei,.fuwuxieyi,.xiangshuode,.jjsj").css("display","block");
                }

            $('.wenben-xsd').css('color','#333');
        })
        var custom_num=0;
        $('.danxuan-btn').click(function(){
            var custom_src=$(this).attr("src");
            var newSrc=custom_src==='<?php echo IMG_PATH ?>bdkd/img/yhq@2x.png'?'<?php echo IMG_PATH ?>bdkd/img/yhq1@2x.png':'<?php echo IMG_PATH ?>bdkd/img/yhq@2x.png';
            $(this).attr('src',newSrc);
            custom_num=custom_num===0?1:0;
            $(".xyzt").val(custom_num);
            console.log($('.xyzt').val());
        });


        var oU=document.querySelector(".rjx-sjr1");
        var foU=document.querySelector(".rjx-fjr1");
        var oU2=document.querySelector(".rjx-sjrxx");
        var foU2=document.querySelector(".rjx-fjrxx");
        var goodsIpt=document.querySelector(".goods");
        var moneyIpt=document.querySelector(".money");
//        var zhongliangIpt=document.querySelector(".zhongliang");

        var g=localStorage;
        var fstr="";
        var fn=g.getItem('fname');
        var fd=g.getItem('fdianhua');
        fstr+=fn+fd;
        if(fn&&fd) {
            foU.value = fstr;
            foU.style.color = '#333';
        }
        var f ="";
        var fx=g.getItem('fdizhi');
        f+=fx;
        if(fx){
            foU2.innerHTML=f;
            foU2.style.color='#333';
        }



        var sstr="";
        var sn=g.getItem('sname');
        var sd=g.getItem('sdianhua');
        sstr+=sn+sd;
        if(sn&&sd){
            oU.value=sstr;
            oU.style.color='#333';
        }
        var s ="";
        var sx=g.getItem('sdizhi');
        var sxxxx=g.getItem('sxxxx');
        s+=sxxxx+sx;
        if(sx&&sxxxx){
            oU2.innerHTML=s;
            foU.style.color='#333';
        }





        /*rongjiax*/
        var gname='';
        var gphone='';
        gname+=fn;
        gphone+=fd;
        $('#rjx-fajianren').val(gname);
        $('#rjx-fajianren1').val(gphone);
        var qname='';
        var qphone='';
        qname+=n;
        qphone+=d;
        $('#rjx-sjianren').val(qname);
        $('#rjx-sjianren1').val(qphone);
        /*rongjiax*/

        function sendinfo() {

            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/sendinfo';
        }
        function getinfo() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/getinfo';
        }

        var wplx = g.getItem('goods');
        var zhongliang = g.getItem('weight');
        var jiaqian = g.getItem('money');
        var kdgsName = g.getItem('gsmz');
        //console.log(kdgsName);
        goodsIpt.value=wplx;
        moneyIpt.value=jiaqian;
//        zhongliangIpt.value=zhongliang;
        $('.zhongliang').val(zhongliang);
        $('#gsmz').val(kdgsName);
//        console.log(zhongliang);

        function weight() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/weight?num='+fcanshu;
        }
        /*input框自适应*/
        var s = zhongliang;
        var dv = document.getElementById('dv');
        dv.firstChild.innerHTML = s;
        document.getElementById('bmmc').value = s;
        document.getElementById('bmmc').style.width=dv.firstChild.offsetWidth+'px';
        /*input框自适应*/

        function sendgood() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/index';
        }
        function qu() {
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/qu';
        }
        function wu(){
            window.location.href = '<?php echo SITE_PATH ?>work/bexpress/wu';
        }
    </script>
</body>
</html>